$(function () {
  var systemlog_datagrid = $("#systemlog_datagrid");
  var systemlog_dialog = $("#systemlog_dialog");
  var systemlog_form = $("#systemlog_form");
  systemlog_datagrid.datagrid({
    url: '/systemlog/query.do',
    fit: true,
    fitColumns: true,
    columns:[[
      {field:'opUser',title:'登录用户',width:100,formatter:function (value, row, index) {
        return value?value.username:"";
      }},
      {field:'opTime',title:'操作时间',width:100},
      {field:"opIp",title:'操作IP',width:100},
      {field:'function',title:'使用功能',width:100},
      {field:'params',title:'操作参数',width:100}
    ]],
    singleSelect: true,
    pagination: true,
    toolbar: "#systemlog_btns",
    sortName: 'hireDate',
    sortOrder: 'desc'

  });



  $("#keyword").searchbox({
    searcher:function(value,name){
    console.log(value);
      systemlog_datagrid.datagrid('load', {
      keyword: value

    });
    },
    prompt:'请输入值',
  });


  systemlog_dialog.dialog({
    buttons: "#save_btns",
    closed: true,
    onClose: function () {
      systemlog_form.form('clear');
    }
  });
  var methodObj = {

    reload: function () {
      systemlog_datagrid.datagrid('reload');
    },

  }
  $("a[data-cmd]").click(function () {
    var methodName = $(this).data('cmd');
    methodObj[methodName]();
  })
})

